/* 
 * Template: Neon District (霓虹街区)
 * Style: Cyberpunk, Neon Glow, Dark Mode
 * Prefix: nd-
 */

:root {
    --nd-bg-color: #121212;
    --nd-text-color: #f5f5f5;
    --nd-neon-purple: #9C27B0;
    --nd-neon-cyan: #00E5FF;
    --nd-border-color: #333333;
    --nd-glow-purple: 0 0 5px #9C27B0, 0 0 10px #9C27B0, 0 0 20px #9C27B0;
    --nd-glow-cyan: 0 0 5px #00E5FF, 0 0 10px #00E5FF, 0 0 20px #00E5FF;
    --nd-box-glow-purple: 0 0 10px rgba(156, 39, 176, 0.5), inset 0 0 10px rgba(156, 39, 176, 0.5);
    --nd-box-glow-cyan: 0 0 10px rgba(0, 229, 255, 0.5), inset 0 0 10px rgba(0, 229, 255, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--nd-bg-color);
    color: var(--nd-text-color);
    font-family: 'Courier New', Courier, monospace, sans-serif;
    line-height: 1.6;
}

a {
    color: var(--nd-neon-cyan);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--nd-neon-purple);
    text-shadow: var(--nd-glow-purple);
}

ul {
    list-style: none;
}

/* Header */
.nd-header-wrapper {
    border-bottom: 2px solid var(--nd-neon-purple);
    box-shadow: 0 2px 15px rgba(156, 39, 176, 0.4);
    margin-bottom: 20px;
    background: #0a0a0a;
}

.nd-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    border-bottom: 1px dashed var(--nd-border-color);
}

.nd-logo-area img {
    max-height: 60px;
    filter: drop-shadow(0 0 8px var(--nd-neon-cyan));
}

.nd-search-box {
    display: flex;
    align-items: center;
}

.nd-search-input {
    background: transparent;
    border: 1px solid var(--nd-neon-cyan);
    color: var(--nd-text-color);
    padding: 8px 15px;
    outline: none;
    box-shadow: var(--nd-box-glow-cyan);
    width: 250px;
}

.nd-search-btn {
    background: var(--nd-neon-cyan);
    color: #000;
    border: none;
    padding: 9px 20px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: var(--nd-glow-cyan);
}

.nd-search-btn:hover {
    background: var(--nd-neon-purple);
    color: #fff;
    box-shadow: var(--nd-glow-purple);
}

.nd-nav-bottom {
    padding: 10px 5%;
}

.nd-nav-menu {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nd-nav-item {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nd-nav-item:hover {
    text-shadow: var(--nd-glow-cyan);
}

/* Layout Containers */
.nd-container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

.nd-main-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

/* Index Specific */
.nd-carousel-placeholder {
    width: 100%;
    height: 300px;
    border: 2px solid var(--nd-neon-cyan);
    box-shadow: var(--nd-box-glow-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    background: repeating-linear-gradient(
        45deg,
        #1a1a1a,
        #1a1a1a 10px,
        #121212 10px,
        #121212 20px
    );
    font-size: 24px;
    text-shadow: var(--nd-glow-cyan);
    letter-spacing: 5px;
}

.nd-section-title {
    font-size: 20px;
    border-left: 4px solid var(--nd-neon-purple);
    padding-left: 10px;
    margin-bottom: 15px;
    text-shadow: var(--nd-glow-purple);
    display: inline-block;
    border-bottom: 1px solid var(--nd-neon-purple);
    padding-bottom: 5px;
}

.nd-index-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    row-gap: 10px;
    margin-bottom: 30px;
}

/* Cards */
.nd-card {
    background: #1a1a1a;
    border: 1px solid var(--nd-border-color);
    transition: all 0.3s;
    overflow: hidden;
    position: relative;
}

.nd-card:hover {
    border-color: var(--nd-neon-cyan);
    box-shadow: var(--nd-box-glow-cyan);
    transform: translateY(-3px);
}

.nd-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--nd-border-color);
    opacity: 0.8;
}

.nd-card:hover .nd-card-img {
    opacity: 1;
}

.nd-card-info {
    padding: 10px;
}

.nd-card-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--nd-text-color);
}

.nd-card-meta {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
}

/* List Page */
.nd-list-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.nd-breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: #aaa;
    border-bottom: 1px dashed var(--nd-border-color);
    padding-bottom: 10px;
}

.nd-breadcrumb a {
    color: var(--nd-neon-purple);
}

.nd-pagination {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.nd-pagination a, .nd-pagination span {
    padding: 5px 12px;
    border: 1px solid var(--nd-neon-cyan);
    color: var(--nd-text-color);
    background: #1a1a1a;
}

.nd-pagination a:hover, .nd-pagination .current {
    background: var(--nd-neon-cyan);
    color: #000;
    box-shadow: var(--nd-glow-cyan);
}

/* Show Page */
.nd-article-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--nd-neon-purple);
    padding-bottom: 20px;
}

.nd-article-title {
    font-size: 28px;
    color: var(--nd-neon-cyan);
    text-shadow: var(--nd-glow-cyan);
    margin-bottom: 10px;
}

.nd-article-meta {
    font-size: 12px;
    color: #777;
}

.nd-article-content {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 30px;
    padding: 20px;
    background: #151515;
    border: 1px solid var(--nd-border-color);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

.nd-article-content img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--nd-neon-purple);
}

.nd-article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--nd-border-color);
}

/* Sidebar */
.nd-sidebar-widget {
    background: #151515;
    border: 1px solid var(--nd-border-color);
    margin-bottom: 20px;
    padding: 15px;
}

.nd-widget-title {
    font-size: 16px;
    color: var(--nd-neon-purple);
    border-bottom: 1px solid var(--nd-border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
    text-shadow: var(--nd-glow-purple);
}

.nd-widget-list li {
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nd-widget-list li::before {
    content: '>';
    color: var(--nd-neon-cyan);
    margin-right: 5px;
}

/* Footer */
.nd-footer {
    border-top: 2px solid var(--nd-neon-cyan);
    box-shadow: 0 -2px 15px rgba(0, 229, 255, 0.4);
    background: #0a0a0a;
    padding: 30px 5%;
    margin-top: 40px;
    text-align: center;
    font-size: 14px;
}

.nd-footer-links {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.nd-footer-info p {
    margin-bottom: 5px;
    color: #888;
}

/* Responsive */
@media (max-width: 992px) {
    .nd-main-grid {
        grid-template-columns: 1fr;
    }
    .nd-index-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .nd-index-grid, .nd-list-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .nd-header-top {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .nd-index-grid, .nd-list-grid {
        grid-template-columns: 1fr;
    }
}


/* ========== 差异化特效 ========== */
/* === 霓虹街区 (nd-) CSS 特效 === */

/* --- 关键帧动画 --- */

/**
 * 1. 霓虹灯闪烁动画
 * 模拟霓虹灯管不稳定的电流效果，应用于标题等元素
 */
@keyframes nd-neon-flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    text-shadow:
      0 0 4px #fff,
      0 0 11px #fff,
      0 0 19px #fff,
      0 0 40px #0ff,
      0 0 80px #0ff,
      0 0 90px #0ff,
      0 0 100px #0ff,
      0 0 150px #0ff;
    opacity: 1;
  }
  20%, 24%, 55% {        
    text-shadow: none;
    opacity: 0.8;
  }
}

/**
 * 2. 发光脉冲动画
 * 用于按钮或需要强调的模块，产生呼吸灯一样的光晕效果
 */
@keyframes nd-glow-pulse {
  0% {
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.8), 0 0 10px rgba(255, 0, 255, 0.6);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5), 0 0 35px rgba(255, 0, 255, 0.4);
  }
  100% {
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.8), 0 0 10px rgba(255, 0, 255, 0.6);
  }
}

/**
 * 3. 霓虹色彩循环动画
 * 使用 hue-rotate 实现赛博朋克风格的色彩变幻，可用于装饰性边框或背景
 */
@keyframes nd-color-cycle {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}


/* --- 交互效果 --- */

/* 1. 链接 Hover 霓虹描边效果 */
.nd-link {
  color: #fff;
  text-decoration: none;
  transition: text-shadow 0.3s ease, color 0.3s ease;
  -webkit-text-stroke: 1px rgba(200, 200, 255, 0.3);
}

.nd-link:hover {
  color: #f0f;
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.8);
  animation: nd-neon-flicker 2s linear infinite alternate;
}

/* 2. 卡片 Hover 电流边框效果 */
.nd-card {
  position: relative;
  background: #1a1a2e;
  border: 2px solid #4b0082;
  transition: transform 0.3s, box-shadow 0.3s;
  overflow: hidden;
}

.nd-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.nd-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.4), transparent);
  transition: left 0.5s ease-in-out;
}

.nd-card:hover::before {
  left: 100%;
}

/* 3. 按钮 Hover 故障艺术效果 */
.nd-button {
  position: relative;
  background-color: #8a2be2;
  color: white;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  overflow: hidden;
  transition: color 0.3s;
}

.nd-button:hover {
  color: #1a1a2e;
}

.nd-button::after {
  content: 'GLITCH';
  position: absolute;
  top: 10px;
  left: 20px;
  color: #0ff;
  opacity: 0;
  transform: translate(-5px, 5px);
  transition: opacity 0.2s;
}

.nd-button:hover::after {
  opacity: 1;
  animation: nd-glitch 0.3s linear infinite;
}

@keyframes nd-glitch {
  0% { transform: translate(-5px, 5px); }
  25% { transform: translate(5px, -5px); }
  50% { transform: translate(-3px, 3px); }
  75% { transform: translate(3px, -3px); }
  100% { transform: translate(-5px, 5px); }
}

/* 4. 图片 Hover 赛博滤镜效果 */
.nd-image-container img {
  transition: filter 0.4s ease-in-out, transform 0.4s ease;
  width: 100%;
}

.nd-image-container:hover img {
  filter: contrast(1.2) brightness(1.1) hue-rotate(90deg) saturate(1.5);
  transform: scale(1.05);
}

/* 5. 标题应用闪烁动画 */
.nd-main-title {
  color: #fff;
  animation: nd-neon-flicker 3s linear infinite;
}

/* 6. 装饰性元素应用色彩循环 */
.nd-deco-line {
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #f0f, #0ff);
  animation: nd-color-cycle 5s linear infinite;
}

/* 7. 导航栏增加呼吸光晕 */
.nd-navbar {
    animation: nd-glow-pulse 4s ease-in-out infinite alternate;
}
